/*
 * @Description: 映射关系设置
 * @Author: Zzt
 * @Date: 2022-11-03 09:49:02
 * @LastEditTime: 2022-12-30 15:08:09
 */

import classNames from 'classnames/bind';
import { MappingRouterTypeContext } from '@/view/system/MappingRelation/contexts/MappingRouterTypeContext';
import { MappingRelationContextProvider } from './contexts/MappingRelationContext';
import NavSidebar from './components/NavSidebar';
import OperateList from './components/OperateList';
import PageLayout from '@/layout/PageLayout';
import { EnumMappingRouteTypes } from './dictionaries';
import styles from './styles/mappingRelation.module.scss';

const cx = classNames.bind(styles);

interface ISysMappingProps {
  routerType?: EnumMappingRouteTypes;
}

export const MappingRelationPage = (props: ISysMappingProps) => {
  const { routerType = EnumMappingRouteTypes.Normal } = props;

  return (
    <MappingRouterTypeContext.Provider value={{ routerType }}>
      <MappingRelationContextProvider>
        <PageLayout className={cx('fond-wrap')} sidebar={<NavSidebar />}>
          <OperateList />
        </PageLayout>
      </MappingRelationContextProvider>
    </MappingRouterTypeContext.Provider>
  );
};

const MappingRelation = () => {
  return <MappingRelationPage />;
};

export default MappingRelation;
